package com.yf.mediaserver.gb.config;


import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Data
@Component
@ConfigurationProperties(prefix = "sip", ignoreInvalidFields = true)
@Order(0)
public class SipConfig {

    private String ip;

    private String showIp;

    private Integer port;

    private String domain;

    private String id;

    private String password;


    private Integer ptzSpeed = 50;

    private Integer registerTimeInterval = 120;

    public String getShowIp() {
        if (this.showIp == null) {
            return this.ip;
        }
        return showIp;
    }

    public  String  getAddr(){
        return String.format("%s:%s",getIp(),getPort());
    }

}
